import axios from 'axios'
import qs from 'qs'
exports.login = function (data) {
  return axios({
    method: 'post',
    url: '/api/combine/user/authorize/validate',
    data: qs.stringify(data)
  })
}
exports.sendMessage = function (data) {
  return axios({
    method: 'post',
    url: '/api/user/forgetpassword/sendmessage',
    data: data
  })
}
exports.getRole = function (id) {
  return axios.get('/api/user/authorize/getRoles', {
    params: {
      userId: id
    }
  })
}
exports.logout = function (id) {
  return axios({
    method: 'post',
    url: '/api/authorize/logout',
    data: qs.stringify({
      userId: id
    })
  })
}
exports.changePassword = function (data) {
  return axios({
    method: 'put',
    url: '/api/user/password/current',
    data: qs.stringify({
      userId: data.userId,
      newPassword: data.newPassword,
      oldPassword: data.oldPassword
    })
  })
}
